package com.ycz.pattern.behaviour.mementopattern;

/**
 * @Description
 * @ClassName Originator
 * @Author yanchengzhi
 * @date 2023.11.29 21:45
 */
public class Originator {

    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Memento saveStateToMemento() {
        return new Memento(state);
    }

    public void getStateFromMemento(Memento memento) {
        state = memento.getState();
    }

}
